\(\int (3+b \sin (e+f x))^2 (c+d \sin (e+f x))^3 \, dx\) [678]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 296 \[ \int (3+b \sin (e+f x))^2 (c+d \sin (e+f x))^3 \, dx=\frac {1}{8} \left (18 b d \left (4 c^2+d^2\right )+b^2 c \left (4 c^2+9 d^2\right )+36 \left (2 c^3+3 c d^2\right )\right ) x-\frac {\left (180 d^2 \left (4 c^2+d^2\right )+90 b c d \left (c^2+4 d^2\right )-b^2 \left (3 c^4-52 c^2 d^2-16 d^4\right )\right ) \cos (e+f x)}{30 d f}-\frac {\left (900 c d^2+90 b d \left (2 c^2+3 d^2\right )-b^2 \left (6 c^3-71 c d^2\right )\right ) \cos (e+f x) \sin (e+f x)}{120 f}-\frac {\left (-3 b c (b c-30 d)+4 \left (45+4 b^2\right ) d^2\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{60 d f}+\frac {b (b c-30 d) \cos (e+f x) (c+d \sin (e+f x))^3}{20 d f}-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f} \]

[Out]

1/8*(6*a*b*d*(4*c^2+d^2)+b^2*c*(4*c^2+9*d^2)+4*a^2*(2*c^3+3*c*d^2))*x-1/30*(20*a^2*d^2*(4*c^2+d^2)+30*a*b*c*d*
(c^2+4*d^2)-b^2*(3*c^4-52*c^2*d^2-16*d^4))*cos(f*x+e)/d/f-1/120*(100*a^2*c*d^2+30*a*b*d*(2*c^2+3*d^2)-b^2*(6*c
^3-71*c*d^2))*cos(f*x+e)*sin(f*x+e)/f-1/60*(4*(5*a^2+4*b^2)*d^2-3*b*c*(-10*a*d+b*c))*cos(f*x+e)*(c+d*sin(f*x+e
))^2/d/f+1/20*b*(-10*a*d+b*c)*cos(f*x+e)*(c+d*sin(f*x+e))^3/d/f-1/5*b^2*cos(f*x+e)*(c+d*sin(f*x+e))^4/d/f

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 314, normalized size of antiderivative = 1.06, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2870, 2832, 2813} \[ \int (3+b \sin (e+f x))^2 (c+d \sin (e+f x))^3 \, dx=-\frac {\left (20 a^2 d^2 \left (4 c^2+d^2\right )+30 a b c d \left (c^2+4 d^2\right )-\left (b^2 \left (3 c^4-52 c^2 d^2-16 d^4\right )\right )\right ) \cos (e+f x)}{30 d f}-\frac {\left (100 a^2 c d^2+30 a b d \left (2 c^2+3 d^2\right )-\left (b^2 \left (6 c^3-71 c d^2\right )\right )\right ) \sin (e+f x) \cos (e+f x)}{120 f}+\frac {1}{8} x \left (4 a^2 \left (2 c^3+3 c d^2\right )+6 a b d \left (4 c^2+d^2\right )+b^2 c \left (4 c^2+9 d^2\right )\right )-\frac {\left (4 d^2 \left (5 a^2+4 b^2\right )-3 b c (b c-10 a d)\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{60 d f}+\frac {b (b c-10 a d) \cos (e+f x) (c+d \sin (e+f x))^3}{20 d f}-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f} \]

[In]

Int[(a + b*Sin[e + f*x])^2*(c + d*Sin[e + f*x])^3,x]

[Out]

((6*a*b*d*(4*c^2 + d^2) + b^2*c*(4*c^2 + 9*d^2) + 4*a^2*(2*c^3 + 3*c*d^2))*x)/8 - ((20*a^2*d^2*(4*c^2 + d^2) +
 30*a*b*c*d*(c^2 + 4*d^2) - b^2*(3*c^4 - 52*c^2*d^2 - 16*d^4))*Cos[e + f*x])/(30*d*f) - ((100*a^2*c*d^2 + 30*a
*b*d*(2*c^2 + 3*d^2) - b^2*(6*c^3 - 71*c*d^2))*Cos[e + f*x]*Sin[e + f*x])/(120*f) - ((4*(5*a^2 + 4*b^2)*d^2 -
3*b*c*(b*c - 10*a*d))*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(60*d*f) + (b*(b*c - 10*a*d)*Cos[e + f*x]*(c + d*Si
n[e + f*x])^3)/(20*d*f) - (b^2*Cos[e + f*x]*(c + d*Sin[e + f*x])^4)/(5*d*f)

Rule 2813

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(2*a*c +
 b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Cos[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rule 2832

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d
)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/(f*(m + 1))), x] + Dist[1/(m + 1), Int[(a + b*Sin[e + f*x])^(m - 1)*Sim
p[b*d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]

Rule 2870

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[(
-d^2)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(b*(m + 2)), Int[(a + b*Sin[e + f
*x])^m*Simp[b*(d^2*(m + 1) + c^2*(m + 2)) - d*(a*d - 2*b*c*(m + 2))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c
, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] &&  !LtQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = -\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f}+\frac {\int (c+d \sin (e+f x))^3 \left (\left (5 a^2+4 b^2\right ) d-b (b c-10 a d) \sin (e+f x)\right ) \, dx}{5 d} \\ & = \frac {b (b c-10 a d) \cos (e+f x) (c+d \sin (e+f x))^3}{20 d f}-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f}+\frac {\int (c+d \sin (e+f x))^2 \left (d \left (20 a^2 c+13 b^2 c+30 a b d\right )+\left (4 \left (5 a^2+4 b^2\right ) d^2-3 b c (b c-10 a d)\right ) \sin (e+f x)\right ) \, dx}{20 d} \\ & = -\frac {\left (4 \left (5 a^2+4 b^2\right ) d^2-3 b c (b c-10 a d)\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{60 d f}+\frac {b (b c-10 a d) \cos (e+f x) (c+d \sin (e+f x))^3}{20 d f}-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f}+\frac {\int (c+d \sin (e+f x)) \left (d \left (150 a b c d+20 a^2 \left (3 c^2+2 d^2\right )+b^2 \left (33 c^2+32 d^2\right )\right )+\left (100 a^2 c d^2+30 a b d \left (2 c^2+3 d^2\right )-b^2 \left (6 c^3-71 c d^2\right )\right ) \sin (e+f x)\right ) \, dx}{60 d} \\ & = \frac {1}{8} \left (6 a b d \left (4 c^2+d^2\right )+b^2 c \left (4 c^2+9 d^2\right )+4 a^2 \left (2 c^3+3 c d^2\right )\right ) x-\frac {\left (20 a^2 d^2 \left (4 c^2+d^2\right )+30 a b c d \left (c^2+4 d^2\right )-b^2 \left (3 c^4-52 c^2 d^2-16 d^4\right )\right ) \cos (e+f x)}{30 d f}-\frac {\left (100 a^2 c d^2+30 a b d \left (2 c^2+3 d^2\right )-b^2 \left (6 c^3-71 c d^2\right )\right ) \cos (e+f x) \sin (e+f x)}{120 f}-\frac {\left (4 \left (5 a^2+4 b^2\right ) d^2-3 b c (b c-10 a d)\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{60 d f}+\frac {b (b c-10 a d) \cos (e+f x) (c+d \sin (e+f x))^3}{20 d f}-\frac {b^2 \cos (e+f x) (c+d \sin (e+f x))^4}{5 d f} \\ \end{align*}

Mathematica [A] (verified)

Time = 2.98 (sec) , antiderivative size = 223, normalized size of antiderivative = 0.75 \[ \int (3+b \sin (e+f x))^2 (c+d \sin (e+f x))^3 \, dx=\frac {-60 \left (12 b \left (4 c^3+9 c d^2\right )+54 \left (4 c^2 d+d^3\right )+b^2 \left (18 c^2 d+5 d^3\right )\right ) \cos (e+f x)+10 d \left (72 b c d+36 d^2+b^2 \left (12 c^2+5 d^2\right )\right ) \cos (3 (e+f x))-6 b^2 d^3 \cos (5 (e+f x))+15 \left (4 \left (4 \left (18+b^2\right ) c^3+72 b c^2 d+9 \left (12+b^2\right ) c d^2+18 b d^3\right ) (e+f x)-8 \left (27 c d^2+b^2 \left (c^3+3 c d^2\right )+6 b \left (3 c^2 d+d^3\right )\right ) \sin (2 (e+f x))+3 b d^2 (b c+2 d) \sin (4 (e+f x))\right )}{480 f} \]

[In]

Integrate[(3 + b*Sin[e + f*x])^2*(c + d*Sin[e + f*x])^3,x]

[Out]

(-60*(12*b*(4*c^3 + 9*c*d^2) + 54*(4*c^2*d + d^3) + b^2*(18*c^2*d + 5*d^3))*Cos[e + f*x] + 10*d*(72*b*c*d + 36
*d^2 + b^2*(12*c^2 + 5*d^2))*Cos[3*(e + f*x)] - 6*b^2*d^3*Cos[5*(e + f*x)] + 15*(4*(4*(18 + b^2)*c^3 + 72*b*c^
2*d + 9*(12 + b^2)*c*d^2 + 18*b*d^3)*(e + f*x) - 8*(27*c*d^2 + b^2*(c^3 + 3*c*d^2) + 6*b*(3*c^2*d + d^3))*Sin[
2*(e + f*x)] + 3*b*d^2*(b*c + 2*d)*Sin[4*(e + f*x)]))/(480*f)

Maple [A] (verified)

Time = 4.08 (sec) , antiderivative size = 226, normalized size of antiderivative = 0.76

method result size
parts \(a^{2} c^{3} x +\frac {\left (2 a b \,d^{3}+3 b^{2} c \,d^{2}\right ) \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )}{f}-\frac {\left (3 a^{2} c^{2} d +2 a b \,c^{3}\right ) \cos \left (f x +e \right )}{f}-\frac {\left (a^{2} d^{3}+6 a b c \,d^{2}+3 b^{2} c^{2} d \right ) \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3 f}+\frac {\left (3 a^{2} c \,d^{2}+6 a b \,c^{2} d +b^{2} c^{3}\right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {b^{2} d^{3} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5 f}\) \(226\)
parallelrisch \(\frac {\left (-240 a b \,d^{3}-360 c \left (a^{2}+b^{2}\right ) d^{2}-720 a b \,c^{2} d -120 b^{2} c^{3}\right ) \sin \left (2 f x +2 e \right )+\left (\left (40 a^{2}+50 b^{2}\right ) d^{3}+240 a b c \,d^{2}+120 b^{2} c^{2} d \right ) \cos \left (3 f x +3 e \right )+\left (30 a b \,d^{3}+45 b^{2} c \,d^{2}\right ) \sin \left (4 f x +4 e \right )-6 b^{2} d^{3} \cos \left (5 f x +5 e \right )+\left (\left (-360 a^{2}-300 b^{2}\right ) d^{3}-2160 a b c \,d^{2}-1440 \left (a^{2}+\frac {3 b^{2}}{4}\right ) c^{2} d -960 a b \,c^{3}\right ) \cos \left (f x +e \right )+\left (360 a b f x -320 a^{2}-256 b^{2}\right ) d^{3}+720 \left (a^{2} f x +\frac {3}{4} b^{2} f x -\frac {8}{3} a b \right ) c \,d^{2}-1440 c^{2} \left (-a b f x +a^{2}+\frac {2}{3} b^{2}\right ) d +480 \left (a^{2} f x +\frac {1}{2} b^{2} f x -2 a b \right ) c^{3}}{480 f}\) \(283\)
derivativedivides \(\frac {-\frac {b^{2} d^{3} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5}+2 a b \,d^{3} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+3 b^{2} c \,d^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-\frac {a^{2} d^{3} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}-2 a b c \,d^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )-b^{2} c^{2} d \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )+3 a^{2} c \,d^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+6 a b \,c^{2} d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+b^{2} c^{3} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-3 a^{2} c^{2} d \cos \left (f x +e \right )-2 a b \,c^{3} \cos \left (f x +e \right )+a^{2} c^{3} \left (f x +e \right )}{f}\) \(325\)
default \(\frac {-\frac {b^{2} d^{3} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5}+2 a b \,d^{3} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+3 b^{2} c \,d^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-\frac {a^{2} d^{3} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}-2 a b c \,d^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )-b^{2} c^{2} d \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )+3 a^{2} c \,d^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+6 a b \,c^{2} d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+b^{2} c^{3} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-3 a^{2} c^{2} d \cos \left (f x +e \right )-2 a b \,c^{3} \cos \left (f x +e \right )+a^{2} c^{3} \left (f x +e \right )}{f}\) \(325\)
risch \(a^{2} c^{3} x +\frac {3 x \,a^{2} c \,d^{2}}{2}+3 x a b \,c^{2} d +\frac {3 a b \,d^{3} x}{4}+\frac {x \,b^{2} c^{3}}{2}+\frac {9 b^{2} c \,d^{2} x}{8}-\frac {3 \cos \left (f x +e \right ) a^{2} c^{2} d}{f}-\frac {3 \cos \left (f x +e \right ) a^{2} d^{3}}{4 f}-\frac {2 \cos \left (f x +e \right ) a b \,c^{3}}{f}-\frac {9 \cos \left (f x +e \right ) a b c \,d^{2}}{2 f}-\frac {9 \cos \left (f x +e \right ) b^{2} c^{2} d}{4 f}-\frac {5 \cos \left (f x +e \right ) b^{2} d^{3}}{8 f}-\frac {b^{2} d^{3} \cos \left (5 f x +5 e \right )}{80 f}+\frac {\sin \left (4 f x +4 e \right ) a b \,d^{3}}{16 f}+\frac {3 \sin \left (4 f x +4 e \right ) b^{2} c \,d^{2}}{32 f}+\frac {d^{3} \cos \left (3 f x +3 e \right ) a^{2}}{12 f}+\frac {d^{2} \cos \left (3 f x +3 e \right ) a b c}{2 f}+\frac {d \cos \left (3 f x +3 e \right ) b^{2} c^{2}}{4 f}+\frac {5 d^{3} \cos \left (3 f x +3 e \right ) b^{2}}{48 f}-\frac {3 \sin \left (2 f x +2 e \right ) a^{2} c \,d^{2}}{4 f}-\frac {3 \sin \left (2 f x +2 e \right ) a b \,c^{2} d}{2 f}-\frac {\sin \left (2 f x +2 e \right ) a b \,d^{3}}{2 f}-\frac {\sin \left (2 f x +2 e \right ) b^{2} c^{3}}{4 f}-\frac {3 \sin \left (2 f x +2 e \right ) b^{2} c \,d^{2}}{4 f}\) \(401\)
norman \(\frac {\left (a^{2} c^{3}+\frac {3}{2} a^{2} c \,d^{2}+3 a b \,c^{2} d +\frac {3}{4} a b \,d^{3}+\frac {1}{2} b^{2} c^{3}+\frac {9}{8} b^{2} c \,d^{2}\right ) x +\left (a^{2} c^{3}+\frac {3}{2} a^{2} c \,d^{2}+3 a b \,c^{2} d +\frac {3}{4} a b \,d^{3}+\frac {1}{2} b^{2} c^{3}+\frac {9}{8} b^{2} c \,d^{2}\right ) x \left (\tan ^{10}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (5 a^{2} c^{3}+\frac {15}{2} a^{2} c \,d^{2}+15 a b \,c^{2} d +\frac {15}{4} a b \,d^{3}+\frac {5}{2} b^{2} c^{3}+\frac {45}{8} b^{2} c \,d^{2}\right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (5 a^{2} c^{3}+\frac {15}{2} a^{2} c \,d^{2}+15 a b \,c^{2} d +\frac {15}{4} a b \,d^{3}+\frac {5}{2} b^{2} c^{3}+\frac {45}{8} b^{2} c \,d^{2}\right ) x \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (10 a^{2} c^{3}+15 a^{2} c \,d^{2}+30 a b \,c^{2} d +\frac {15}{2} a b \,d^{3}+5 b^{2} c^{3}+\frac {45}{4} b^{2} c \,d^{2}\right ) x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (10 a^{2} c^{3}+15 a^{2} c \,d^{2}+30 a b \,c^{2} d +\frac {15}{2} a b \,d^{3}+5 b^{2} c^{3}+\frac {45}{4} b^{2} c \,d^{2}\right ) x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {90 a^{2} c^{2} d +20 a^{2} d^{3}+60 a b \,c^{3}+120 a b c \,d^{2}+60 b^{2} c^{2} d +16 b^{2} d^{3}}{15 f}-\frac {\left (6 a^{2} c^{2} d +4 a b \,c^{3}\right ) \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {\left (12 a^{2} c \,d^{2}+24 a b \,c^{2} d +6 a b \,d^{3}+4 b^{2} c^{3}+9 b^{2} c \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {\left (12 a^{2} c \,d^{2}+24 a b \,c^{2} d +6 a b \,d^{3}+4 b^{2} c^{3}+9 b^{2} c \,d^{2}\right ) \left (\tan ^{9}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}-\frac {\left (12 a^{2} c \,d^{2}+24 a b \,c^{2} d +14 a b \,d^{3}+4 b^{2} c^{3}+21 b^{2} c \,d^{2}\right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}+\frac {\left (12 a^{2} c \,d^{2}+24 a b \,c^{2} d +14 a b \,d^{3}+4 b^{2} c^{3}+21 b^{2} c \,d^{2}\right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}-\frac {2 \left (12 a^{2} c^{2} d +2 a^{2} d^{3}+8 a b \,c^{3}+12 a b c \,d^{2}+6 b^{2} c^{2} d \right ) \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {2 \left (54 a^{2} c^{2} d +14 a^{2} d^{3}+36 a b \,c^{3}+84 a b c \,d^{2}+42 b^{2} c^{2} d +16 b^{2} d^{3}\right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}-\frac {\left (72 a^{2} c^{2} d +20 a^{2} d^{3}+48 a b \,c^{3}+120 a b c \,d^{2}+60 b^{2} c^{2} d +16 b^{2} d^{3}\right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{5}}\) \(891\)

[In]

int((a+b*sin(f*x+e))^2*(c+d*sin(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

a^2*c^3*x+(2*a*b*d^3+3*b^2*c*d^2)/f*(-1/4*(sin(f*x+e)^3+3/2*sin(f*x+e))*cos(f*x+e)+3/8*f*x+3/8*e)-(3*a^2*c^2*d
+2*a*b*c^3)/f*cos(f*x+e)-1/3*(a^2*d^3+6*a*b*c*d^2+3*b^2*c^2*d)/f*(2+sin(f*x+e)^2)*cos(f*x+e)+(3*a^2*c*d^2+6*a*
b*c^2*d+b^2*c^3)/f*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-1/5*b^2*d^3/f*(8/3+sin(f*x+e)^4+4/3*sin(f*x+e)^2
)*cos(f*x+e)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 247, normalized size of antiderivative = 0.83 \[ \int (3+b \sin (e+f x))^2 (c+d \sin (e+f x))^3 \, dx=-\frac {24 \, b^{2} d^{3} \cos \left (f x + e\right )^{5} - 40 \, {\left (3 \, b^{2} c^{2} d + 6 \, a b c d^{2} + {\left (a^{2} + 2 \, b^{2}\right )} d^{3}\right )} \cos \left (f x + e\right )^{3} - 15 \, {\left (24 \, a b c^{2} d + 6 \, a b d^{3} + 4 \, {\left (2 \, a^{2} + b^{2}\right )} c^{3} + 3 \, {\left (4 \, a^{2} + 3 \, b^{2}\right )} c d^{2}\right )} f x + 120 \, {\left (2 \, a b c^{3} + 6 \, a b c d^{2} + 3 \, {\left (a^{2} + b^{2}\right )} c^{2} d + {\left (a^{2} + b^{2}\right )} d^{3}\right )} \cos \left (f x + e\right ) - 15 \, {\left (2 \, {\left (3 \, b^{2} c d^{2} + 2 \, a b d^{3}\right )} \cos \left (f x + e\right )^{3} - {\left (4 \, b^{2} c^{3} + 24 \, a b c^{2} d + 10 \, a b d^{3} + 3 \, {\left (4 \, a^{2} + 5 \, b^{2}\right )} c d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{120 \, f} \]

[In]

integrate((a+b*sin(f*x+e))^2*(c+d*sin(f*x+e))^3,x, algorithm="fricas")

[Out]

-1/120*(24*b^2*d^3*cos(f*x + e)^5 - 40*(3*b^2*c^2*d + 6*a*b*c*d^2 + (a^2 + 2*b^2)*d^3)*cos(f*x + e)^3 - 15*(24
*a*b*c^2*d + 6*a*b*d^3 + 4*(2*a^2 + b^2)*c^3 + 3*(4*a^2 + 3*b^2)*c*d^2)*f*x + 120*(2*a*b*c^3 + 6*a*b*c*d^2 + 3
*(a^2 + b^2)*c^2*d + (a^2 + b^2)*d^3)*cos(f*x + e) - 15*(2*(3*b^2*c*d^2 + 2*a*b*d^3)*cos(f*x + e)^3 - (4*b^2*c
^3 + 24*a*b*c^2*d + 10*a*b*d^3 + 3*(4*a^2 + 5*b^2)*c*d^2)*cos(f*x + e))*sin(f*x + e))/f

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 729 vs. \(2 (292) = 584\).

Time = 0.35 (sec) , antiderivative size = 729, normalized size of antiderivative = 2.46 \[ \int (3+b \sin (e+f x))^2 (c+d \sin (e+f x))^3 \, dx=\begin {cases} a^{2} c^{3} x - \frac {3 a^{2} c^{2} d \cos {\left (e + f x \right )}}{f} + \frac {3 a^{2} c d^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {3 a^{2} c d^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {3 a^{2} c d^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {a^{2} d^{3} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 a^{2} d^{3} \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac {2 a b c^{3} \cos {\left (e + f x \right )}}{f} + 3 a b c^{2} d x \sin ^{2}{\left (e + f x \right )} + 3 a b c^{2} d x \cos ^{2}{\left (e + f x \right )} - \frac {3 a b c^{2} d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {6 a b c d^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {4 a b c d^{2} \cos ^{3}{\left (e + f x \right )}}{f} + \frac {3 a b d^{3} x \sin ^{4}{\left (e + f x \right )}}{4} + \frac {3 a b d^{3} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{2} + \frac {3 a b d^{3} x \cos ^{4}{\left (e + f x \right )}}{4} - \frac {5 a b d^{3} \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{4 f} - \frac {3 a b d^{3} \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{4 f} + \frac {b^{2} c^{3} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {b^{2} c^{3} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {b^{2} c^{3} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {3 b^{2} c^{2} d \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b^{2} c^{2} d \cos ^{3}{\left (e + f x \right )}}{f} + \frac {9 b^{2} c d^{2} x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {9 b^{2} c d^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {9 b^{2} c d^{2} x \cos ^{4}{\left (e + f x \right )}}{8} - \frac {15 b^{2} c d^{2} \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {9 b^{2} c d^{2} \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} - \frac {b^{2} d^{3} \sin ^{4}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {4 b^{2} d^{3} \sin ^{2}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac {8 b^{2} d^{3} \cos ^{5}{\left (e + f x \right )}}{15 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right )^{2} \left (c + d \sin {\left (e \right )}\right )^{3} & \text {otherwise} \end {cases} \]

[In]

integrate((a+b*sin(f*x+e))**2*(c+d*sin(f*x+e))**3,x)

[Out]

Piecewise((a**2*c**3*x - 3*a**2*c**2*d*cos(e + f*x)/f + 3*a**2*c*d**2*x*sin(e + f*x)**2/2 + 3*a**2*c*d**2*x*co
s(e + f*x)**2/2 - 3*a**2*c*d**2*sin(e + f*x)*cos(e + f*x)/(2*f) - a**2*d**3*sin(e + f*x)**2*cos(e + f*x)/f - 2
*a**2*d**3*cos(e + f*x)**3/(3*f) - 2*a*b*c**3*cos(e + f*x)/f + 3*a*b*c**2*d*x*sin(e + f*x)**2 + 3*a*b*c**2*d*x
*cos(e + f*x)**2 - 3*a*b*c**2*d*sin(e + f*x)*cos(e + f*x)/f - 6*a*b*c*d**2*sin(e + f*x)**2*cos(e + f*x)/f - 4*
a*b*c*d**2*cos(e + f*x)**3/f + 3*a*b*d**3*x*sin(e + f*x)**4/4 + 3*a*b*d**3*x*sin(e + f*x)**2*cos(e + f*x)**2/2
 + 3*a*b*d**3*x*cos(e + f*x)**4/4 - 5*a*b*d**3*sin(e + f*x)**3*cos(e + f*x)/(4*f) - 3*a*b*d**3*sin(e + f*x)*co
s(e + f*x)**3/(4*f) + b**2*c**3*x*sin(e + f*x)**2/2 + b**2*c**3*x*cos(e + f*x)**2/2 - b**2*c**3*sin(e + f*x)*c
os(e + f*x)/(2*f) - 3*b**2*c**2*d*sin(e + f*x)**2*cos(e + f*x)/f - 2*b**2*c**2*d*cos(e + f*x)**3/f + 9*b**2*c*
d**2*x*sin(e + f*x)**4/8 + 9*b**2*c*d**2*x*sin(e + f*x)**2*cos(e + f*x)**2/4 + 9*b**2*c*d**2*x*cos(e + f*x)**4
/8 - 15*b**2*c*d**2*sin(e + f*x)**3*cos(e + f*x)/(8*f) - 9*b**2*c*d**2*sin(e + f*x)*cos(e + f*x)**3/(8*f) - b*
*2*d**3*sin(e + f*x)**4*cos(e + f*x)/f - 4*b**2*d**3*sin(e + f*x)**2*cos(e + f*x)**3/(3*f) - 8*b**2*d**3*cos(e
 + f*x)**5/(15*f), Ne(f, 0)), (x*(a + b*sin(e))**2*(c + d*sin(e))**3, True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 314, normalized size of antiderivative = 1.06 \[ \int (3+b \sin (e+f x))^2 (c+d \sin (e+f x))^3 \, dx=\frac {480 \, {\left (f x + e\right )} a^{2} c^{3} + 120 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} c^{3} + 720 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a b c^{2} d + 480 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b^{2} c^{2} d + 360 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} c d^{2} + 960 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a b c d^{2} + 45 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} c d^{2} + 160 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a^{2} d^{3} + 30 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} a b d^{3} - 32 \, {\left (3 \, \cos \left (f x + e\right )^{5} - 10 \, \cos \left (f x + e\right )^{3} + 15 \, \cos \left (f x + e\right )\right )} b^{2} d^{3} - 960 \, a b c^{3} \cos \left (f x + e\right ) - 1440 \, a^{2} c^{2} d \cos \left (f x + e\right )}{480 \, f} \]

[In]

integrate((a+b*sin(f*x+e))^2*(c+d*sin(f*x+e))^3,x, algorithm="maxima")

[Out]

1/480*(480*(f*x + e)*a^2*c^3 + 120*(2*f*x + 2*e - sin(2*f*x + 2*e))*b^2*c^3 + 720*(2*f*x + 2*e - sin(2*f*x + 2
*e))*a*b*c^2*d + 480*(cos(f*x + e)^3 - 3*cos(f*x + e))*b^2*c^2*d + 360*(2*f*x + 2*e - sin(2*f*x + 2*e))*a^2*c*
d^2 + 960*(cos(f*x + e)^3 - 3*cos(f*x + e))*a*b*c*d^2 + 45*(12*f*x + 12*e + sin(4*f*x + 4*e) - 8*sin(2*f*x + 2
*e))*b^2*c*d^2 + 160*(cos(f*x + e)^3 - 3*cos(f*x + e))*a^2*d^3 + 30*(12*f*x + 12*e + sin(4*f*x + 4*e) - 8*sin(
2*f*x + 2*e))*a*b*d^3 - 32*(3*cos(f*x + e)^5 - 10*cos(f*x + e)^3 + 15*cos(f*x + e))*b^2*d^3 - 960*a*b*c^3*cos(
f*x + e) - 1440*a^2*c^2*d*cos(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 269, normalized size of antiderivative = 0.91 \[ \int (3+b \sin (e+f x))^2 (c+d \sin (e+f x))^3 \, dx=-\frac {b^{2} d^{3} \cos \left (5 \, f x + 5 \, e\right )}{80 \, f} + \frac {1}{8} \, {\left (8 \, a^{2} c^{3} + 4 \, b^{2} c^{3} + 24 \, a b c^{2} d + 12 \, a^{2} c d^{2} + 9 \, b^{2} c d^{2} + 6 \, a b d^{3}\right )} x + \frac {{\left (12 \, b^{2} c^{2} d + 24 \, a b c d^{2} + 4 \, a^{2} d^{3} + 5 \, b^{2} d^{3}\right )} \cos \left (3 \, f x + 3 \, e\right )}{48 \, f} - \frac {{\left (16 \, a b c^{3} + 24 \, a^{2} c^{2} d + 18 \, b^{2} c^{2} d + 36 \, a b c d^{2} + 6 \, a^{2} d^{3} + 5 \, b^{2} d^{3}\right )} \cos \left (f x + e\right )}{8 \, f} + \frac {{\left (3 \, b^{2} c d^{2} + 2 \, a b d^{3}\right )} \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} - \frac {{\left (b^{2} c^{3} + 6 \, a b c^{2} d + 3 \, a^{2} c d^{2} + 3 \, b^{2} c d^{2} + 2 \, a b d^{3}\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \]

[In]

integrate((a+b*sin(f*x+e))^2*(c+d*sin(f*x+e))^3,x, algorithm="giac")

[Out]

-1/80*b^2*d^3*cos(5*f*x + 5*e)/f + 1/8*(8*a^2*c^3 + 4*b^2*c^3 + 24*a*b*c^2*d + 12*a^2*c*d^2 + 9*b^2*c*d^2 + 6*
a*b*d^3)*x + 1/48*(12*b^2*c^2*d + 24*a*b*c*d^2 + 4*a^2*d^3 + 5*b^2*d^3)*cos(3*f*x + 3*e)/f - 1/8*(16*a*b*c^3 +
 24*a^2*c^2*d + 18*b^2*c^2*d + 36*a*b*c*d^2 + 6*a^2*d^3 + 5*b^2*d^3)*cos(f*x + e)/f + 1/32*(3*b^2*c*d^2 + 2*a*
b*d^3)*sin(4*f*x + 4*e)/f - 1/4*(b^2*c^3 + 6*a*b*c^2*d + 3*a^2*c*d^2 + 3*b^2*c*d^2 + 2*a*b*d^3)*sin(2*f*x + 2*
e)/f

Mupad [B] (verification not implemented)

Time = 8.77 (sec) , antiderivative size = 358, normalized size of antiderivative = 1.21 \[ \int (3+b \sin (e+f x))^2 (c+d \sin (e+f x))^3 \, dx=-\frac {90\,a^2\,d^3\,\cos \left (e+f\,x\right )+75\,b^2\,d^3\,\cos \left (e+f\,x\right )-10\,a^2\,d^3\,\cos \left (3\,e+3\,f\,x\right )-\frac {25\,b^2\,d^3\,\cos \left (3\,e+3\,f\,x\right )}{2}+\frac {3\,b^2\,d^3\,\cos \left (5\,e+5\,f\,x\right )}{2}+30\,b^2\,c^3\,\sin \left (2\,e+2\,f\,x\right )-30\,b^2\,c^2\,d\,\cos \left (3\,e+3\,f\,x\right )+90\,a^2\,c\,d^2\,\sin \left (2\,e+2\,f\,x\right )+90\,b^2\,c\,d^2\,\sin \left (2\,e+2\,f\,x\right )-\frac {45\,b^2\,c\,d^2\,\sin \left (4\,e+4\,f\,x\right )}{4}+240\,a\,b\,c^3\,\cos \left (e+f\,x\right )+360\,a^2\,c^2\,d\,\cos \left (e+f\,x\right )+270\,b^2\,c^2\,d\,\cos \left (e+f\,x\right )+60\,a\,b\,d^3\,\sin \left (2\,e+2\,f\,x\right )-\frac {15\,a\,b\,d^3\,\sin \left (4\,e+4\,f\,x\right )}{2}-120\,a^2\,c^3\,f\,x-60\,b^2\,c^3\,f\,x-60\,a\,b\,c\,d^2\,\cos \left (3\,e+3\,f\,x\right )+180\,a\,b\,c^2\,d\,\sin \left (2\,e+2\,f\,x\right )-180\,a^2\,c\,d^2\,f\,x-135\,b^2\,c\,d^2\,f\,x+540\,a\,b\,c\,d^2\,\cos \left (e+f\,x\right )-90\,a\,b\,d^3\,f\,x-360\,a\,b\,c^2\,d\,f\,x}{120\,f} \]

[In]

int((a + b*sin(e + f*x))^2*(c + d*sin(e + f*x))^3,x)

[Out]

-(90*a^2*d^3*cos(e + f*x) + 75*b^2*d^3*cos(e + f*x) - 10*a^2*d^3*cos(3*e + 3*f*x) - (25*b^2*d^3*cos(3*e + 3*f*
x))/2 + (3*b^2*d^3*cos(5*e + 5*f*x))/2 + 30*b^2*c^3*sin(2*e + 2*f*x) - 30*b^2*c^2*d*cos(3*e + 3*f*x) + 90*a^2*
c*d^2*sin(2*e + 2*f*x) + 90*b^2*c*d^2*sin(2*e + 2*f*x) - (45*b^2*c*d^2*sin(4*e + 4*f*x))/4 + 240*a*b*c^3*cos(e
 + f*x) + 360*a^2*c^2*d*cos(e + f*x) + 270*b^2*c^2*d*cos(e + f*x) + 60*a*b*d^3*sin(2*e + 2*f*x) - (15*a*b*d^3*
sin(4*e + 4*f*x))/2 - 120*a^2*c^3*f*x - 60*b^2*c^3*f*x - 60*a*b*c*d^2*cos(3*e + 3*f*x) + 180*a*b*c^2*d*sin(2*e
 + 2*f*x) - 180*a^2*c*d^2*f*x - 135*b^2*c*d^2*f*x + 540*a*b*c*d^2*cos(e + f*x) - 90*a*b*d^3*f*x - 360*a*b*c^2*
d*f*x)/(120*f)